﻿#include"Contact.h"
void Menu()
{
	printf("\n");
	printf("***************************************\n");
	printf("******* 0.exit      1.Add    **********\n");
	printf("******* 2.Delete    3.Search **********\n");
	printf("******* 4.Mondify   5.Show   **********\n");
	printf("******* 6.Sort               **********\n");
	printf("***************************************\n");

}
int main()
{
	int input = 0;
	Contact con;
	IntiContact(&con);
	do {
		Menu();
		printf("请输入>");
		scanf("%d", &input);
		switch (input)
		{
		case 0:
			SaveContact(&con);//保存
			Destroyed(&con);
			printf("退出\n");
			break;
		case 1:
			Add(&con);
			break;
		case 2:
			Delete(&con);
			break;
		case 3:
			Search(&con);
			break;
		case 4:
			Modify(&con);
			break;
		case 5:
			Show(&con);
			break;
		case 6:
			Sort(&con);
			break;
		default:
			printf("选择错误请重新输入\n");
		}
	} while (input);
}